package com.zhitan.netty.enums;

/**
 * 订单类型枚举类 1正常订单 2离线订单
 *
 **/
public enum OrderTypeEnum {

    /**
     * 订单来源枚举类
     */
    OFFLINE( 2, "离线订单"),
    NORMAL( 1, "正常订单");

    private final Integer code;

    private final String message;

    OrderTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static OrderTypeEnum match(int key) {
        OrderTypeEnum result = null;
        for (OrderTypeEnum s : values()) {
            if (s.getCode() == key) {
                result = s;
                break;
            }
        }
        return result;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
